/* Copyright (c) 2010 Google Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.google.orkut.client.api.samples.greetings.client.services;

import static com.google.orkut.client.api.samples.greetings.client.services.Objects.eq;
import static com.google.orkut.client.api.samples.greetings.client.services.Objects.hashCodeOf;

import com.google.orkut.client.api.Album;

import java.io.Serializable;

/**
 * Information about an album from orkut client library's {@link Album}.
 *
 * @author Shishir Birmiwal
 */
public class AlbumInfo implements Serializable {
  public String id;
  public String ownerId;
  public String title;
  public String thumbnailUrl;
  public int numPhotos;

  @Override
  public boolean equals(Object obj) {
    if (this == obj) {
      return true;
    }
    if (!(obj instanceof AlbumInfo)) {
      return false;
    }
    AlbumInfo that = (AlbumInfo) obj;
    return eq(id, that.id) && eq(ownerId, that.ownerId) && eq(thumbnailUrl, that.thumbnailUrl)
        && eq(title, that.title) && eq(numPhotos, that.numPhotos);
  }

  @Override
  public int hashCode() {
    return hashCodeOf(id, ownerId, title, thumbnailUrl, numPhotos);
  }
}
